import Vue from 'vue'
import VueRouter from "vue-router";

const Home = () => import('../views/home/Home')
const Category = () => import('../views/category/Category')
const Cart = () => import('../views/cart/Cart')
const Profile = () => import('../views/profile/Profile')
const Detail = () => import('../views/detail/Detail')
const zhucedenglu = () => import('../views/zhucedenglu/zhucedenglu')

Vue.use(VueRouter)
//
// if (module.hot) {
//   module.hot.accept();
// }

const routes = [
  {
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    meta:{
      ShowTab: true
    }
  },
  {
    path: '/category',
    component: Category,
    meta:{
      ShowTab: true
    }
  },
  {
    path: '/cart',
    component: Cart,
    meta:{
      ShowTab: true
    }
  },
  {
    path: '/profile',
    component: Profile,
    meta:{
      ShowTab: true
    }
  },
  {
    path: '/detail/:iid',
    component: Detail
  },
  {
    path: '/zhucedenglu',
    component: zhucedenglu,
    meta:{
      ShowTab: false
    }
  }
]
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location)
}
const router = new VueRouter({
  routes,
  mode: 'history'
})
export default router
